﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Class_KetNoi;

namespace GiaoDien
{
    public partial class uc_ChiTietKhenThuong : DevExpress.XtraEditors.XtraUserControl
    {
        public uc_ChiTietKhenThuong()
        {
            InitializeComponent();
        }
        KetNoi_KhenThuong kn = new KetNoi_KhenThuong();
        public void LoadDuLieu()
        {
            gridControl1.DataSource = kn.LoadDuLieu();

        }
        private void uc_ChiTietKhenThuong_Load(object sender, EventArgs e)
        {
            kn.connect();
            LoadDuLieu();
        }

        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            try
            {
                gridControl1.DataSource = kn.TraCuu_MaKhenThuong(txtNoidung.Text);
                errorProvider1.Clear();
            }
            catch (Exception)
            {
                errorProvider1.SetError(txtNoidung,"Chỉ được nhập số từ 1-9!");
            }
        }

        private void btnlamMoi_Click(object sender, EventArgs e)
        {
            LoadDuLieu();
        }
    }
}
